import { observer } from 'mobx-react-lite'
import { authStore } from '@renderer/store/user'
import { Navigate } from 'react-router-dom'
import { ReactNode } from 'react'
interface IProps {
  children: ReactNode
}

const Access: React.FC<IProps> = observer((props) => {
  console.log('---authStore', authStore)
  return <>{authStore.isAuthenticated ? props.children : <Navigate to="/login" />}</>
})

export default Access
